<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>bilin</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>bilin</b> -  general bilinear transform</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[sl1]=bilin(sl,v)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>sl,sl1</b>
        </tt>: linear systems (<tt>
          <b>syslin</b>
        </tt> lists)</li>
      <li>
        <tt>
          <b>v</b>
        </tt>: real vector with 4 entries (<tt>
          <b>v=[a,b,c,d]</b>
        </tt>)</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    Given a linear system in state space form, <tt>
        <b>sl=syslin(dom,A,B,C,D)</b>
      </tt> 
    (<tt>
        <b>syslin</b>
      </tt> list), <tt>
        <b>sl1=bilin(sl,v)</b>
      </tt>  returns in <tt>
        <b>sl1</b>
      </tt> a 
    linear system with matrices <tt>
        <b>[A1,B1,C1,D1]</b>
      </tt> such that
    the transfer function <tt>
        <b>H1(s)=C1*inv(s*eye()-A1)*B1+D1</b>
      </tt> is
    obtained from <tt>
        <b>H(z)=C*inv(z*eye()-A)*B+D</b>
      </tt> by replacing <tt>
        <b>z</b>
      </tt>
    by <tt>
        <b>z=(a*s+b)/(c*s+d)</b>
      </tt>.
    One has <tt>
        <b>w=bilin(bilin(w,[a,b,c,d]),[d,-b,-c,a])</b>
      </tt>
    </p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

s=poly(0,'s');z=poly(0,'z');
w=ssrand(1,1,3);
wtf=ss2tf(w);v=[2,3,-1,4];a=v(1);b=v(2);c=v(3);d=v(4);
[horner(wtf,(a*z+b)/(c*z+d)),ss2tf(bilin(w,[a,b,c,d]))]
clean(ss2tf(bilin(bilin(w,[a,b,c,d]),[d,-b,-c,a]))-wtf)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../polynomials/horner.htm">
        <tt>
          <b>horner</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="cls2dls.htm">
        <tt>
          <b>cls2dls</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
